home *** CD-ROM | disk | FTP | other *** search
- /* Fetch script for use with AmIRC 1.x */ Version='1.06'/*
- // Written by Deryk Robosson 11.19.96
- //
- // 11.24.96 - added .readme fetching support
- // 16.1.97 - added support for result codes
- // 4.2.97 - added path variable for ftpget and updated
- // the docs
- // added support for not obtaining the .readmes
- // added multi site support - Requested by TheBarron
- // 13.2.97 - added .readme viewing support - Suggested by Gallant
- // optimised the source - Suggestions made by Gallant
- // 4.3.97 - prettied up the display of information
- //
- // newlook@ameritech.net newlook on #amiga IRC (EfNet)
- */
- esc=d2c(27)
- bold=d2c(2)
- underline=x2c('1F')
-
- /* this is the default site list, edit for any changes */
- site0 = "wuarchive.wustl.edu"
- site1 = "ftp.netnet.net"
- site2 = "ftp.uni-paderborn.de"
- site3 = "ftp.doc.ic.ac.uk"
- site4 = "ftp.ninemoons.com"
-
- /* change this to 0 if you don't want readme files, 1 otherwise */
- readmes=1
-
- /* change this to 0 if you don't want the readme files displayed after download , 1 otherwise */
- displayreadme=1
-
- /* Change this to your favorite site */
- defaultsite=site0 /*'wuarchive.wustl.edu'*/
-
- /* Change this to your default incoming directory */
- incomingdir="in:"
-
- /* Change this to reflect the path of ftpget */
- path="amitcp:bin/ftpget"
-
- /* Change this to your favorite text viewer */
- textviewer="sys:utilities/multiview"
-
- /* Change this to your email address */
- pass="newlook@ameritech.net"
-
- options results
- parse arg file" "param
-
- if file="" then do
- Call Version()
- Exit
- end
- if upper(file)="VER" then do
- Call Version()
- Exit
- end
- if upper(file)="HELP" then do
- Call Help()
- Exit
- end
- if upper(file)="SITELIST" then do
- Call ListSites()
- Exit
- end
- if param~="" then do
- select
- when param=0 then defaultsite=site0
- when param=1 then defaultsite=site1
- when param=2 then defaultsite=site2
- when param=3 then defaultsite=site3
- when param=4 then defaultsite=site4
- otherwise
- defaultsite=site0
- end
- end
-
- /* prepare for the main file */
- remote="REMOTE /pub/aminet/"file
-
- /* prepare for the readme file */
- if readmes=1 then do
- file1=left(file,length(file)-3) /* truncate the filename */
- file2=file1||'readme' /* append the readme */
- remote=remote" /pub/aminet/"file2 /* append readme to remote */
- end
-
- /* setup the commandline parameters */
- getit=path||" "||defaultsite||" "||remote||" LOCAL "||incomingdir||" USER anonymous PASS "||pass||" QUIET"
- ADDRESS COMMAND getit /* grab the file */
-
- select /* inform the user as to the status of the command */
- when rc=0 then "echo File retrieval finished."
- when rc=21 then "echo P="ESC||BOLD"«Fetch» Invalid arguments"
- when rc=22 then "echo P="ESC||BOLD"«Fetch» Cannot locate the given file list."
- when rc=23 then "echo P="ESC||BOLD"«Fetch» Couldn't open bsdsocket.library."
- when rc=24 then "echo P="ESC||BOLD"«Fetch» Cannot allocate enough memory for the buffer."
- when rc=25 then "echo P="ESC||BOLD"«Fetch» Invalid password argument."
- when rc=26 then "echo P="ESC||BOLD"«Fetch» Remote site doesn't exist."
- when rc=27 then "echo P="ESC||BOLD"«Fetch» Remote server not responding/unavailable."
- when rc=28 then "echo P="ESC||BOLD"«Fetch» User name not accepted at remote site."
- when rc=29 then "echo P="ESC||BOLD"«Fetch» Password not accepted at remote site."
- when rc=30 then "echo P="ESC||BOLD"«Fetch» Account not accepted at remote site."
- when rc=31 then "echo P="ESC||BOLD"«Fetch» Cannot obtain the remote file/permission denied."
- when rc=32 then "echo P="ESC||BOLD"«Fetch» Cannot create the local file."
- when rc=33 then "echo P="ESC||BOLD"«Fetch» Transfer aborted or Transfer error."
- otherwise
- "echo P="ESC||BOLD"«Fetch» An unknown error has occured."
- end
-
- if readmes=1 then if displayreadme=1 then address COMMAND textviewer||" "incomingdir||substr(file2,lastpos('/',file2)+1,length(file2))
- EXIT
-
- Version:
- "ECHO P="ESC||BOLD"«Fetch» "BOLD"Fetch.AMIRX"BOLD" Version "BOLD||VERSION||BOLD
- "ECHO P="ESC||BOLD"«Fetch» Read the top of Fetch.AMIRX script for history."
- "ECHO P="ESC||BOLD"«Fetch» "BOLD"©1996"BOLD" Deryk Robosson "BOLD"(newlook)"BOLD" - [newlook@ameritech.net]"
- "ECHO P="ESC||BOLD"«Fetch» "BOLD"HELP:"BOLD" /<alias> help"
- return
-
- Help:
- "ECHO P="ESC||BOLD"«Fetch» "BOLD"Fetch.AMIRX"BOLD" Help"
- "ECHO P="ESC||BOLD"«Fetch» /<alias> comm/tcp/AmIRCFetch.lha 2 to get file from site #2"
- "ECHO P="ESC||BOLD"«Fetch» "BOLD"SITELIST - "BOLD"displays current aminet site list"
- "ECHO P="ESC||BOLD"«Fetch» "BOLD"VER - "BOLD"displays script version"
- "ECHO P="ESC||BOLD"«Fetch» "BOLD"HELP - "BOLD"displays this file"
- return
-
- ListSites:
- "ECHO P="ESC||BOLD"«Fetch» "BOLD||UNDERLINE"SiteList"BOLD||UNDERLINE
- "ECHO P="ESC||BOLD"«Fetch» 0 - wuarchive.wustl.edu"
- "ECHO P="ESC||BOLD"«Fetch» 1 - ftp.netnet.net"
- "ECHO P="ESC||BOLD"«Fetch» 2 - ftp.uni-paderborn.de"
- "ECHO P="ESC||BOLD"«Fetch» 3 - ftp.doc.ic.ac.uk"
- "ECHO P="ESC||BOLD"«Fetch» 4 - ftp.ninemoons.com"
- return
-